local_pgm      := $(subdirectory)/kiwii-server
local_src      := $(patsubst $(SOURCE_DIR)/%,%,$(wildcard $(SOURCE_DIR)/$(subdirectory)/*.cxx))
dependent_libs := backend net comm
main_file      := $(addsuffix .cxx,$(local_pgm))

programs += $(local_pgm)
sources  += $(main_file)

$(eval $(call make-library,$(subdirectory)/lib$(subdirectory).a,$(filter-out $(main_file),$(local_src))))

$(eval $(call make-program,$(local_pgm),$(subst .cxx,.o,$(main_file)),$(dependent_libs)))
